-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(iroh): Enable iroh_docsrs feature #2780
Conversation
This uses the same iroh_docsrs cfg as the other crates and updates the preview CI job to also use this. Now we get the features documented everywhere and get to see it in the preview.
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2780/docs/iroh/ Last updated: 2024-10-04T14:51:47Z |
Somehow this doesn't work yet, the features show up for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try using doc(auto_cfg)
@flub?
There's little material about it online, but essentially it boils down to
- Use
!#[doc(auto_cfg)]
in yourlib.rs
, then - all
#[cfg(...)]
s are picked up automagically.
You can see an example of this in ed25519-dalek
source code.
And how it renders.
I swear I tried this and failed, while doing it manually did work. Maybe its worth trying this again now that at least the basics are working. I'm tempted to kick this to an other PR though and would rather merge this as working. |
## Description This uses the same iroh_docsrs cfg as the other crates and updates the preview CI job to also use this. ## Breaking Changes None ## Notes & open questions However, the world is a sad place. As far as I can figure out this all correctly annotates the features in our docs in the individual crates. That is, `https://docs.rs/iroh-net` and `https://docs.rs/iroh-gossip` etc. This is also true for the `iroh` crate. BUT, the iroh crate uses `doc(inline)` on the other crates, and when using this we can not get the feature annotation in the sub-crates. Sad times. ## Change checklist - [x] Self-review. - ~~[ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant.~~ - ~~[ ] Tests if relevant.~~ - ~~[ ] All breaking changes documented.~~
Description
This uses the same iroh_docsrs cfg as the other crates and updates the
preview CI job to also use this.
Breaking Changes
None
Notes & open questions
However, the world is a sad place.
As far as I can figure out this all correctly annotates the features in our docs in the individual crates. That is,
https://docs.rs/iroh-net
andhttps://docs.rs/iroh-gossip
etc. This is also true for theiroh
crate. BUT, the iroh crate usesdoc(inline)
on the other crates, and when using this we can not get the feature annotation in the sub-crates. Sad times.Change checklist
[ ] Documentation updates following the style guide, if relevant.[ ] Tests if relevant.[ ] All breaking changes documented.